<template>
	<view class="userpost userIndex" :class="[isDark?'dark':'', AppStyle]" :style="{'background-color':isDark?'#1c1c1c':'#f6f6f6','min-height':isDark?'100vh':'auto'}">
		<view class="header" :style="[{height:CustomBar*2 + 'upx'}]" :class="scrollTop>40?'goScroll':''">
			<view class="cu-bar" :class="scrollTop>40?(isDark?'color-white':'color-black'):'color-white'" :style="{'height': CustomBar*2 + 'rpx','padding-top':StatusBar*2 + 'rpx', 'background-color': scrollTop>40?(isDark?'#1c1c1c !important':'#ffffff !important'):'transparent !important'}">
				<view :class="scrollTop<40 && isLoading !== 0 ?'action2 cu-bar2':''" class="action"
					style="width: 60upx;height: 60upx;" @tap="back">
					<text class="tn-icon-left" style="margin-left: 0;margin-right: 0;"></text>
				</view>
				<view class="content text-bold" style="height: 60upx;" :style="[{top:StatusBar*2 + 'upx'}]">
					<block v-if="scrollTop>40">
						<text :class="isvip ? 'text-shojo2' : ''">
							{{name}}
						</text>
					</block>
				</view>
				<!--  #ifdef H5 || APP-PLUS -->
				<view class="action" style="margin-right: 0upx;">
					<view :class="scrollTop<40 && isLoading !== 0 ?'action2 cu-bar2':''" class="action"
						style="width: 60upx;height: 60upx;margin-right: 20upx;margin-left: 0upx;" @tap="toSearch">
						<text class="tn-icon-search" style="margin-left: 0;margin-right: 0;"></text>
					</view>
					<view :class="scrollTop<40 && isLoading !== 0 ?'action2 cu-bar2':''" class="action"
						style="width: 60upx;height: 60upx;" @click="moreShow = true">
						<text class="tn-icon-align" style="margin-left: 0;margin-right: 0;"></text>
					</view>
				</view>
				<!--  #endif -->
			</view>
		</view>
		<!--  #ifdef H5 || APP-PLUS -->

		<tn-popup v-model="moreShow" mode="bottom" :closeBtn="true" :height="mySelf?'30%':'20%'" :borderRadius="20">
			<view class="center-container tn-margin-top-xxl">
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="!mySelf"
					@tap="toJb(name),moreShow=false">
					<text class="tn-icon-warning" style="margin-right: 5px;"></text>{{$t('content.userinfo.reportuser')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="!mySelf&&ban==0&&token!=''"
					@tap="toBan(1),moreShow=false">
					<text class="tn-icon-block" style="margin-right: 5px;"></text>{{$t('content.userinfo.blockuser')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="!mySelf&&ban==vid&&token!=''"
					@tap="toBan(0),moreShow=false">
					<text class="tn-icon-block" style="margin-right: 5px;"></text>{{$t('content.userinfo.unblockother')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}"
					v-if="isFollow==0&&!mySelf" @tap="follow(1),moreShow=false">
					<text class="tn-icon-my-add" style="margin-right: 5px;"></text>{{$t('global.follownow')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}"
					v-if="isFollow==1&&!mySelf" @tap="follow(0),moreShow=false">
					<text class="tn-icon-my-reduce" style="margin-right: 5px;"></text>{{$t('global.unfollow')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="!mySelf"
					@tap="getPrivateChat(),moreShow=false">
					<text class="tn-icon-email" style="margin-right: 5px;"></text>{{$t('content.userinfo.sendprivate')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="mySelf"
					@tap="toUserEdit(),moreShow=false">
					<text class="tn-icon-identity" style="margin-right: 5px;"></text>{{$t('content.userinfo.editprofile')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="mySelf"
					@tap="toRz(),moreShow=false">
					<text class="tn-icon-trusty" style="margin-right: 5px;"></text>{{$t('content.userinfo.bluevapply')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="mySelf"
					@tap="tosetSafe(),moreShow=false">
					<text class="tn-icon-safe" style="margin-right: 5px;"></text>{{$t('content.userinfo.accountsecurity')}}
				</view>
				<view class="tn-padding-sm tn-radius popup-content sy-text-lg" :class="isDark?'dark':'bg-flex-shadow'" :style="{'background-color':isDark?'#2c2c2c':'#fff','color':isDark?'#fff':'#333'}" v-if="mySelf"
					@tap="toSet(),moreShow=false">
					<text class="tn-icon-set" style="margin-right: 5px;"></text>{{$t('content.userinfo.systemset')}}
				</view>
			</view>
		</tn-popup>
		<!--  #endif -->
		<!-- <view :style="[{padding:NavBar + 'px 10px 0px 10px'}]"></view> -->
		<view class="all-box" style="margin-top:-10upx">

			<view class="user-info" :style="'padding-top:'+NavBar*2 + 'upx;height:480upx;position:initial'">
				<view class="user-info-bg" v-if="userBg==''">
					<tn-lazy-load :image="avatar" imgMode="aspectFill" style="height:450upx"></tn-lazy-load>
				</view>
				<view class="user-info-bg" v-else>
					<tn-lazy-load :image="userBg" imgMode="aspectFill" style="height:450upx"></tn-lazy-load>
				</view>
				<view class="user-info-main" style="background-color: transparent;">
					<view class="user-info-content"
						style="background: transparent;padding: 0upx 0upx 0upx 60upx;z-index: 99;">
						<view class="user-info-col" style="overflow:visible">
							<!-- <view class="user-header" style="width: 180upx;">
								<view class="user-rz">
									<image :src="avatar"
										style="width: 180upx;height: 180upx;border: 6upx solid white;border-radius:90upx;background-color:white;">
									</image>
									
								</view>
							</view> -->
							<avatarItem :avatar="avatar" :lvrz="lvrz"></avatarItem>
						</view>
						<div class="user-text" style="width: calc(100% - 200upx);color: black;text-align: center;">
							<div class="user-info-data col-3" style="padding:65upx 20upx 0upx 20upx;">
								<div class="user-info-data-box" @tap="goFanList(uid)">
									<div class="user-data-num">{{formatNumber(fanNum)}}<text v-if="fanNum>9999"
											class="sup-script">{{$t('global.thousand')}}</text></div>
									<div class="user-data-label" style="opacity:1">{{$t('global.fans')}}</div>
								</div>
								<div class="user-info-data-box" @tap="toLink('/pages/user/followList?uid='+uid)">
									<div class="user-data-num">{{formatNumber(fancount)}}<text v-if="fancount>9999"
											class="sup-script">{{$t('global.thousand')}}</text></div>
									<div class="user-data-label" style="opacity:1">{{$t('common.nofollow')}}</div>
								</div>
								<div class="user-info-data-box">
									<div class="user-data-num">{{formatNumber(likesall)}}<text v-if="likesall>9999"
											class="sup-script">{{$t('global.thousand')}}</text></div>
									<div class="user-data-label" style="opacity:1">{{$t('global.like')}}</div>
								</div>
							</div>
						</div>
					</view>
					<view class="padding-tb" :class="isDark?'dark':'bg-white'" :style="{'background-color':isDark?'#1c1c1c':'#ffffff'}"
						style="position: absolute; width: 100%; bottom:0upx;border-radius: 32upx 32upx 0 0;height:120upx;">
					</view>
				</view>
			</view>

			<view class="user-name" style="padding: 10upx 60upx 0upx 60upx;">
				<view class="user-info-name"
					style="font-size: 45upx;font-weight: 600;color: black;display: flex;align-items: center;"
					@click="copyName">
					<view :class="isvip ? 'text-shojo2' : ''">
						{{name}}
					</view>
					<view style="line-height: 0px;">
						<image v-if="xb=='man'" :src="manImg"
							style="border-radius: 0px;margin-left: 12upx;margin-right: 0upx;width: 44upx;"
							mode="widthFix"></image>
						<image v-if="xb=='woman'" :src="womanImg"
							style="border-radius: 0px;margin-left: 12upx;margin-right: 0upx;width: 44upx;"
							mode="widthFix"></image>
					</view>
				</view>
				
				<view class="user-info-data-box" style="text-align: left;margin-top: 6upx;display: flex;align-items: center;" v-if="lvrz==1">
				<image class="rz-icon" style="width: 36upx;height: 36upx;" :src="rzImg" mode="aspectFill"></image>
				<text class="user-data-label" style="margin-left: 10upx;font-weight: bold;" :style="{'color':isDark?'#3b9bff !important':'#2e8ced !important'}">{{lvrzName}}</text>
				</view>
				<view class="user-info-data-box" style="text-align: left;margin-top: 8upx;">
					<text class="user-data-label" @click="copyUid">{{appname}}: </text>
					<text class="user-data-label" style="margin-right: 10upx;" @click="copyUid">{{uid}}</text>
					<text class="tn-icon-copy mirror" @click="copyUid"></text>
				</view>
				
				<view class="user-data-label text-content" style="margin-top: 10upx;word-wrap: break-word">
					<block v-if="introduce!=''&&introduce">
						{{introduce}}
					</block>
					<block v-else>
						{{$t('global.nopersoninfo')}}
					</block>
				</view>

				<view class="user-info-data-box"
					style="margin-top: 10upx;text-align: left;display: flex;align-items: center;">

					<image v-if="isvip>0" :src="vipImg" 
						style="border-radius: 0px;margin-left: 6upx;margin-right: 0upx;height: 35upx;" 
						mode="heightFix">
					</image>
					<image :src="lvImg+getLv(experience)+'.png'"
						style="border-radius: 0px;margin-left: 6upx;margin-right: 0upx;height: 35upx;"
						mode="heightFix">
					</image>
					<text class="userlv customize"
						style="border: 3upx solid black;color:black;padding: 0upx 8upx;border-radius: 40upx;background-color: transparent;font-size: 22upx;height: 35upx;line-height: 35upx;"
						v-if="customize&&customize!=''">{{customize}}</text>
					<text class="userlv customize"
						style="border: 3upx solid #00BCD4;color:#00BCD4;padding: 0upx 8upx;border-radius: 40upx;background-color: transparent;font-size: 22upx;height: 35upx;line-height: 35upx;"
						v-if="smrz==1">{{$t('content.userinfo.alrealname')}}</text>
				</view>


				<view class="user-info-data-box" style="margin-top: 10upx;text-align: center;margin-right: 0upx;">
					<view v-if="uid==vid" class="userInfo-bottom-main grid2 col-2">

						<view class="userInfo-bottom-box" style="padding:0upx 15upx 0upx 0upx;width: 70%;">
							<button class="cu-btn bg-gray" style="border-radius: 100upx" @tap="toUserEdit()"><text
									class="tn-icon-edit-form"></text>{{$t('content.userinfo.editinfo')}}</button>
						</view>
						<view class="userInfo-bottom-box" style="padding:0upx 0upx 0upx 15upx;width: 30%;">
							<button class="cu-btn"
								style="border-radius: 100upx;background-color: #f0f0f0;color: #333333;"
								@tap="toSet()"><text class="tn-icon-set"></text>{{$t('content.userinfo.infoset')}}</button>
						</view>
					</view>
					<view v-else class="userInfo-bottom-main grid col-2">
						<view class="userInfo-bottom-box" style="padding:0upx 15upx 0upx 0upx;">
							<button class="cu-btn bg-gray" style="border-radius: 100upx;" @tap="follow(0)"
								v-if="isFollow==1"><text class="cuIcon-check"></text>{{$t('common.alfollow')}}</button>
							<button class="cu-btn bg-gray"
								style="border-radius: 100upx;background: #3cc9a4;color: white;" @tap="follow(1)"
								v-else><text class="cuIcon-add"></text>{{$t('common.nofollow')}}</button>
						</view>
						<view class="userInfo-bottom-box" style="padding:0upx 0upx 0upx 15upx;">
							<button class="cu-btn"
								style="border-radius: 100upx;background-color: #f0f0f0;color: #333333;"
								@tap="getPrivateChat()"><text class="cuIcon-mark"></text>{{$t('content.userinfo.privatemsg')}}</button>
						</view>
					</view>
				</view>
			</view>

			<view :class="sy_appbox?'search-type grid col-4':'search-type grid col-3'">
				<view class="search-type-box" v-if="sy_appbox&&appModOrder==1" @tap="toType(4)"
					:class="type==4?'active':''">
					<text>{{$t('content.userinfo.utilize')}}</text>
				</view>
				<view class="search-type-box" v-if="wzof==1&&modOrder==2" @tap="toType(0)" :class="type==0?'active':''">
					<text>{{$t('common.article')}}</text>
				</view>
				<view class="search-type-box" v-if="tzof==1" @tap="toType(3)" :class="type==3?'active':''">
					<text>{{$t('global.post')}}</text>
				</view>
				<view class="search-type-box" v-if="wzof==1&&modOrder==1" @tap="toType(0)" :class="type==0?'active':''">
					<text>{{$t('common.article')}}</text>
				</view>
				<view class="search-type-box" v-if="sy_appbox&&appModOrder==0" @tap="toType(4)"
					:class="type==4?'active':''">
					<text>{{$t('content.userinfo.utilize')}}</text>
				</view>
				<view class="search-type-box" @tap="toType(2)" :class="type==2?'active':''">
					<text>{{$t('global.trends')}}</text>
				</view>

			</view>
			<view class="margin-top-sm padding-sm" :class="isDark?'dark':'bg-white'" :style="{'background-color':isDark?'#1c1c1c':'#ffffff'}" v-if="type==4">
				<!-- 添加加载动画 -->
				<view class="loading-container" v-if="apploading">
					<u-loading mode="circle" size="36"></u-loading>
				</view>
				
				<!-- 应用列表 -->
				<block v-if="applist.length>0">
					<view class="app-box" v-for="(item, index) in applist" :key="index">
						<view class="app-box-body" @tap="toAppInfo(item.id)">
							<view class="app-box-logo">
								<u-image :src="item.logo" width="110rpx" height="110rpx" mode="aspectFill" 
									:lazy-load="true" :fade="true" duration="450" border-radius="28rpx">
									<u-loading slot="loading"></u-loading>
								</u-image>
							</view>
							<view class="app-box-content">
								<view class="app-box-title text-cut">{{item.name}}</view>
								<view class="app-box-info">
									<text :style="{color: item.tagInfo.color}" 
										:class="item.score>=3?'tn-icon-star-fill':'tn-icon-star'"></text>
									<text :style="{color: item.tagInfo.color}">{{item.score}}</text>
									<text>{{item.size}}</text>
									<text :class="item.system=='ios'?'tn-icon-iphone':''"></text>
									</view>
									<view class="app-box-tags">
										<text class="app-tag"
											:style="{backgroundColor: item.tagInfo.color}">{{item.tagInfo.text}}</text>
										<text v-for="(category, idx) in item.sortJson" :key="idx"
											class="app-category-tag">{{category.name}}</text>
									</view>
							</view>
						</view>
						<view class="app-box-down" @tap="toAppInfo(item.id)">{{$t('common.download')}}</view>
					</view>
				</block>
				
				<!-- 空数据提示 -->
				<block v-else>
					<view class="margin-top-sm">
						<u-empty text="$t('content.userinfo.noapplication')" mode="data" icon-size="100" font-size="24"></u-empty>
					</view>
				</block>
				
				<!-- 加载更多 -->
				<view class="load-more" @tap="loadMore" v-if="applist.length>0">
					<text>{{moreText}}</text>
				</view>
			</view>
			<view class="cu-card article no-card" v-if="type==0">
				<view class="padding-left-sm padding-right-sm">
					<block v-for="(item,index) in contentsList" :key="index" v-if="type==0&&actStyle==1">
						<articleItemA :item="item"></articleItemA>
					</block>
					<block v-for="(item,index) in contentsList" :key="index" v-if="type==0&&actStyle==2">
						<articleItemB :item="item"></articleItemB>
					</block>
				</view>
				<block v-if="type==0&&actStyle==3">
					<tn-waterfall ref="waterfall" v-model="contentsList" @finish="handleWaterFallFinish"
						style="margin: 0upx 10upx;">
						<template v-slot:left="{ leftList }">
							<view v-for="(item,index) in leftList" :key="index">
								<articleItemWfA :item="item"></articleItemWfA>
							</view>
						</template>
						<template v-slot:right="{ rightList }">
							<view v-for="(item,index) in rightList" :key="index">
								<articleItemWfB :item="item"></articleItemWfB>
							</view>
						</template>
					</tn-waterfall>
				</block>
				<view class="load-more" @tap="loadMore" v-if="contentsList.length>0">
					<text>{{moreText}}</text>
				</view>
				<view class="no-data" v-if="contentsList.length==0">
					<text class="cuIcon-text"></text>
					{{$t('common.nodata')}}
				</view>

			</view>
			<view class="search-space" v-if="type==2">
				<view class="no-data" :class="isDark?'dark':'bg-white'" :style="{'background-color':isDark?'#1c1c1c':'#ffffff'}" v-if="spaceList.length==0">
					<text class="cuIcon-text"></text>
					$t('content.userinfo.notrend')
				</view>
				<spaceItem :spaceList="spaceList" :isDark="isDark"></spaceItem>
				<view class="load-more" @tap="loadMore" v-if="spaceList.length>0">
					<text>{{moreText}}</text>
				</view>
			</view>
			<!--论坛帖子-->
			<view class="forum-list-main" v-if="type==3">
				<view class="no-data" v-if="postList.length==0">
					<text class="cuIcon-text"></text>{{$t('content.userinfo.tempnopost')}}
				</view>
				<block v-for="(item,index) in postList" :key="index">
					<forumItem :item="item" :myPurview="0" :mySelf="mySelf"></forumItem>
				</block>
				<view class="load-more" @tap="loadMore" v-if="postList.length>0">
					<text>{{moreText}}</text>
				</view>
			</view>
			<!--论坛帖子结束-->
			<!--评论-->
			<view class="cu-list menu-avatar" v-if="type==1">
				<view class="no-data" v-if="commentsList.length==0">
					<text class="cuIcon-text"></text>
					{{$t('global.nocomment')}}
				</view>
				<view class="cu-card dynamic no-card" style="margin-top: 20upx;">
					<block v-for="(item,index) in commentsList" :key="index" v-if="commentsList.length>0">
						<commentItem :item="item" :isHead="false"></commentItem>
					</block>

				</view>

				<view class="load-more" @tap="loadMore" v-if="commentsList.length>0">
					<text>{{moreText}}</text>
				</view>
			</view>
			<!--评论结束-->

			<!--占位区域
			<view style="width: 100%;height: 100upx; background-color: #f6f6f6;"></view>-->
		</view>
		<!--加载遮罩-->
		<view class="loading" v-if="isLoading==0">
			<view class="loading-main">
				<image src="../../static/loading.gif"></image>
			</view>
		</view>
		<!--加载遮罩结束-->
		<view class="full-noLogin" v-if="isuserlogin">
			<view class="full-noLogin-main">
				<view class="full-noLogin-text">
					{{$t('global.loginafterview')}}
				</view>
				<view class="full-noLogin-btn">
					<view class="cu-btn bg-blue" @tap="goLogin()">
						{{$t('global.loginnow')}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		localStorage
	} from '../../js_sdk/mp-storage/mp-storage/index.js'
	import darkModeMixin from '@/utils/darkModeMixin.js'
	// #ifdef APP-PLUS
	import owo from '../../static/app-plus/owo/OwO.js'
	// #endif
	// #ifdef H5
	import owo from '../../static/h5/owo/OwO.js'
	// #endif
	// #ifdef MP
	var owo = [];
	// #endif
	export default {
		mixins: [darkModeMixin],
		data() {
			return {
				StatusBar: this.StatusBar,
				CustomBar: this.CustomBar,
				NavBar: this.StatusBar + this.CustomBar,
				AppStyle: this.$store.state.AppStyle,
				sy_appbox: false, 
				appModOrder: 2, 
				applist: [], 
				chatid: 0,
				ban: 0,
				apppage: 1,
				apploading: false, 
				contentsList: [],
				commentsList: [],
				spaceList: [],
				postList: [],
				isuserlogin: false,
				userList: [],
				owo: owo,
				owoList: [],
				wzof: 0,
				tzof: 0,
				modOrder: 0,
				type: 0,
				submitStatus1: false,
				page: 1,
				moreText: $t('common.loadmoretxt'),
				list: [],
				isLoad: 0,
				rzImg: this.$API.SPRz(),
				isLoading: 0,
				actStyle: 0,
				title: "",
				uid: 0,
				token: "",
				manImg: this.$API.SPman(),
				womanImg: this.$API.SPwoman(),
				vipImg: this.$API.SPvip(),
				lvImg: this.$API.SPLv(),
				avatar: "",
				name: "",
				customize: "",
				lv: "",
				vip: "",
				xb: "",
				moreShow: false,
				isvip: "",
				experience: 0,
				introduce: "",
				lvrzName: "",
				userBg: "",
				fanNum: 0,
				contentsNum: 0,
				commentsNum: 0,
				scrollTop: 0,
				isFollow: 0,
				likesall: 0,
				modalName:'',
				list: [],
				fancount: 0,
				userinfo: null,
				vid: 0,
				appname: this.$API.GetuserID(),
				local: "",
				mySelf: false,
				lvrz: 0,
				smrz: 0,
			}
		},
		onPageScroll(res) {
			var that = this;
			that.scrollTop = res.scrollTop;
		},
		onShow() {
			var that = this;
			uni.$emit('tOnLazyLoadReachBottom');
		},
		onReachBottom() {
			//触底后执行的方法，比如无限加载之类的
			var that = this;
			if (that.isLoad == 0) {
				that.loadMore();
			}
		},
		onPullDownRefresh() {
			var that = this;
			var i = that.type;
			that.getUserInfo();
			that.page = 1;
			that.moreText = that.$t('common.loadmoretxt');
			that.isLoad = 0;
			if (i == 0) {
				that.getContentsList(false);
			} else if (i == 1) {
				that.getCommentsList(false)
			} else if (i == 3) {
				that.getPostList(false)
			} else {
				that.getSpaceList(false)
			}
			var timer = setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000)
		},
		onLoad(res) {
			var that = this;
			var cachedPlugins = localStorage.getItem('getPlugins');
			if (cachedPlugins) {
				var pluginList = JSON.parse(cachedPlugins);
				// 检查插件是否存在于插件列表中
				// #ifdef APP-PLUS || H5
				that.sy_appbox = pluginList.includes('sy_appbox');
				// #endif
			}
			if(that.sy_appbox){
				that.getAppBoxInfo();
			}else{
				that.getSetCC();
			}
			// #ifdef APP-PLUS || MP
			that.NavBar = that.CustomBar;
			// #endif
			that.title = res.title;
			that.uid = res.uid;
			that.avatar = res.avatar;
			// 获取基础数据
			that.getLike();
			that.identifyStatus();
			that.getIsFollow();
			that.getUserInfo();
			that.getSet();
			// #ifdef APP-PLUS || H5
			var owo = that.owo.data;
			var owoList = [];
			for (var i in owo) {
				owoList = owoList.concat(owo[i].container);
			}
			that.owoList = owoList;
			// #endif
			// 根据不同类型加载对应数据
			if(that.type == 0) {
				that.getContentsList(false);
			} else if(that.type == 1) {
				that.getCommentsList(false);
			} else if(that.type == 3) {
				that.getPostList(false);
			} else if(that.type == 4) {
				that.getAppList(false);
			} else {
				that.getSpaceList(false);
			}
			if (localStorage.getItem('userinfo')) {
				var userInfo = JSON.parse(localStorage.getItem('userinfo'));
				that.vid = userInfo.uid;
				that.userinfo = userInfo;
				that.token = userInfo.token;
			}
			// #ifdef APP-PLUS
			if (that.uid == that.vid) {
				that.mySelf = true;
			}
			// #endif
			that.getPrivateChat(true);
		},
		mounted() {
			var that = this;
			// #ifdef APP-PLUS
			that.initStatusBarStyle();
			// #endif
		},
		methods: {
			getSet() {
				var that = this;
				uni.request({
					url: that.$API.SPset(),
					method: 'GET',
					dataType: "json",
					success(res) {
						that.actStyle = res.data.actStyle;
					},
					fail(error) {
						
					}
				})
			},
			getPrivateChat(isBan = false) {
				var that = this;
				var token = "";
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				} else {
					if(!isBan){
						uni.showToast({
							title: that.$t('common.plslogin'),
							icon: 'none'
						})
						uni.navigateTo({
							url: '/pages/user/login'
						});
						return false;
					}
				}
				var touid = that.uid;
				var data = {
					"touid": touid,
					"token": token
				}
				if(!isBan){
					uni.showLoading({
						title: that.$t('common.loadmore')
					});
				}
				that.$Net.request({
					url: that.$API.getPrivateChat(),
					data: data,
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if(!isBan){
							setTimeout(function() {
								uni.hideLoading();
							}, 1000);
						}
						if (res.data.code == 1) {
							var name = that.name;
							var uid = that.uid;
							var chatid = res.data.data
							that.chatid = chatid
							if(!isBan){
								uni.redirectTo({
									url: '/pages/chat/chat?uid=' + uid + "&name=" + name + "&chatid=" + chatid
								});
							}else{
								that.getGroupInfo(that.chatid);
							}
						} else {
							if(!isBan){
								uni.showToast({
									title: res.data.msg,
									icon: 'none'
								})
							}
						}
					},
					fail: function(res) {
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						})
					}
				})
			},
			getGroupInfo(id) {
				var that = this;
				var data = {
					"id": id,
				}
				that.$Net.request({
					url: that.$API.groupInfo(),
					data: data,
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if (res.data.code == 1) {
							that.ban = res.data.data.ban;
						}
					},
					fail: function(res) {
						
					}
				});
			},
			showModal(e) {
				this.modalName = e.currentTarget.dataset.target
			},
			hideModal() {
				this.modalName = null
			},
			toBan(type) {
				var that = this;
				var token = "";
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				} else {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					uni.navigateTo({
						url: '/pages/user/login'
					});
					return false;
				}
				that.hideModal();
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				}
				var data = {
					"id": that.chatid,
					"token": token,
					"type": type
				}
				var tips = "";
				if(type==1){
					tips = that.$t('content.userinfo.sureshieldother');
				}else{
					tips = that.$t('content.userinfo.sureunblockother');
				}
				
				uni.showModal({
					title: tips,
					success: function(res) {
						if (res.confirm) {
							uni.showLoading({
								title: that.$t('common.loadmore')
							});
							that.$Net.request({
								url: that.$API.banChat(),
								data: data,
								header: {
									'Content-Type': 'application/x-www-form-urlencoded'
								},
								method: "get",
								dataType: 'json',
								success: function(res) {
									setTimeout(function() {
										uni.hideLoading();
									}, 1000);
									uni.showToast({
										title: res.data.msg,
										icon: 'none'
									})
									if (res.data.code == 1) {
										if(type==1){
											that.ban = that.vid;
										}else{
											that.ban = 0;
										}
									}
								},
								fail: function(res) {
									setTimeout(function() {
										uni.hideLoading();
									}, 1000);
									uni.showToast({
										title: that.$t('common.networkfail'),
										icon: 'none'
									})
								}
							})
						}
					}
				});
			},
			getSetCC() {
				var that = this;
				uni.request({
					url: that.$API.SPset(),
					method: 'GET',
					dataType: "json",
					success(res) {
						that.wzof = res.data.wzof;
						that.tzof = res.data.tzof;
						that.modOrder = res.data.modOrder;
						// 设置初始type
						if (that.tzof == 1 && that.wzof == 1 && that.modOrder == 2 && that.appModOrder == 0) {
							that.type = 0;
						} else if (that.tzof == 1 && that.appModOrder == 0) {
							that.type = 3;
						} else if (that.tzof == 1 && that.wzof != 1 && !that.sy_appbox) {
							that.type = 3;
						} else if (that.sy_appbox && that.appModOrder == 1) {
							that.type = 4;
						} else {
							that.type = 0;
						}
						// 直接加载对应数据
						if(that.type == 0) {
							that.getContentsList(false);
						} else if(that.type == 1) {
							that.getCommentsList(false);
						} else if(that.type == 3) {
							that.getPostList(false);
						} else if(that.type == 4) {
							that.getAppList(false);
						} else {
							that.getSpaceList(false);
						}
					},
					fail(error) {
						
					}
				})
			},
			// #ifdef APP-PLUS
			initStatusBarStyle() {
				if (uni.getSystemInfoSync().platform === 'android') {
					plus.navigator.setStatusBarStyle('light'); // Android 平台
				} else {
					plus.navigator.setStatusBarStyle('light'); // iOS 平台
				}
			},
			onPageScroll(event) {
				this.scrollTop = event.scrollTop;
				if (this.scrollTop > 40) {
					if (uni.getSystemInfoSync().platform === 'android') {
						plus.navigator.setStatusBarStyle('dark'); // Android 平台
					} else {
						plus.navigator.setStatusBarStyle('dark'); // iOS 平台
					}
				} else {
					if (uni.getSystemInfoSync().platform === 'android') {
						plus.navigator.setStatusBarStyle('light'); // Android 平台
					} else {
						plus.navigator.setStatusBarStyle('light'); // iOS 平台
					}
				}
			},
			// #endif
			getLike() {
				var that = this;
				uni.request({
					url: that.$API.SPlikeall(),
					method: 'GET',
					data: {
						uid: that.uid
					},
					dataType: "json",
					success(res) {
						that.likesall = res.data.likesall;
						that.fanNum = res.data.fscount;
						that.fancount = res.data.gzcount;
					},
					fail(error) {
						
					}
				})
			},
			getDowns(downs) {
				var that = this;
				if (downs <= 999) {
					return downs;
				} else if (downs > 999 && downs <= 9999) {
					return (downs / 1000).toFixed(1) + that.$t('global.thousand');
				} else if (downs > 9999) {
					return (downs / 10000).toFixed(1) + that.$t('global.many');
				}
			},
			toType(i) {
				var that = this;
				// 如果切换到相同类型，不重新加载
				if(that.type === i) {
					return;
				}
				that.type = i;
				that.page = 1;
				that.moreText = that.$t('common.loadmoretxt');
				that.isLoad = 0;
				if(i == 0) {
					that.getContentsList(false);
				} else if(i == 1) {
					that.getCommentsList(false);
				} else if(i == 3) {
					that.getPostList(false);
				} else if(i == 4) {
					that.getAppList(false);
				} else {
					that.getSpaceList(false);
				}
			},
			goFanList(uid) {
				uni.navigateTo({
					url: '/pages/user/fanList?uid=' + uid
				});
			},

			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			getUserLv(i) {
				var that = this;
				if (!i) {
					var i = 0;
				}
				var rankList = that.$API.GetRankList();
				return rankList[i];
			},
			getUserLvStyle(i) {
				var that = this;
				if (!i) {
					var i = 0;
				}
				var rankStyle = that.$API.GetRankStyle();
				var userlvStyle = "color:#fff;background-color: " + rankStyle[i];
				return userlvStyle;
			},
			identifyStatus() {
				var that = this;
				that.$Net.request({
					url: that.$API.identifyStatus(),
					data: {
						"uid": that.uid
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if (res.data.code == 1) {
							that.identifyCompany = res.data.data.identifyCompany;
							that.identifyConsumer = res.data.data.identifyConsumer;
						}
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					},
					fail: function(res) {
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						})
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					}
				})
			},
			copyName() {
				var that = this;
				uni.setClipboardData({
					data: that.name,
					success: function() {
						uni.showToast({
							title: that.$t('content.userinfo.nicknamecopy'),
							icon: 'success'
						})
					}
				})
			},
			copyUid() {
				var that = this;
				uni.setClipboardData({
					data: that.uid,
					success: function() {
						uni.showToast({
							title: that.$t('content.userinfo.idcopy'),
							icon: 'success'
						})
					}
				})
			},
			toLink(text) {
				var that = this;
				if (!localStorage.getItem('token') || localStorage.getItem('token') == "") {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					return false;
				}
				// if(that.uid==that.vid){
				// }
				uni.navigateTo({
					url: text
				});
			},
			copyName() {
				var that = this;
				uni.setClipboardData({
					data: that.name,
					success: function() {
						uni.showToast({
							title: that.$t('content.userinfo.nicknamecopy'),
							icon: 'success'
						})
					}
				})
			},
			getUserInfo() {
				var that = this;
				that.$Net.request({
					url: that.$API.getUserInfo(),
					data: {
						"key": that.uid
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if (res.data.code == 1) {
							if (res.data.data.screenName) {
								that.name = res.data.data.screenName;
							} else {
								that.name = res.data.data.name;
							}
							that.xb = res.data.data.url;
							that.local = res.data.data.local;
							that.vip = res.data.data.vip;
							that.isvip = res.data.data.isvip;
							that.lv = res.data.data.lv;
							that.avatar = res.data.data.avatar;
							that.customize = res.data.data.customize;
							that.lvrz = res.data.data.lvrz;
							that.smrz = res.data.data.smrz;
							that.introduce = res.data.data.introduce;
							that.lvrzName = res.data.data.lvrzName;
							that.experience = res.data.data.experience;
							if (res.data.data.userBg) {
								that.userBg = res.data.data.userBg;
							}
						}
					},
					fail: function(res) {
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						})
					}
				})
			},
			getLv(i) {
				var that = this;
				if (!i) {
					var i = 0;
				}
				var lv = that.$API.getLever(i);
				return lv;
			},
			loadMore() {
				var that = this;
				that.moreText = that.$t('global.loading');
				that.isLoad = 1;
				if (that.type == 0) {
					that.getContentsList(true);
				} else if (that.type == 1) {
					that.getCommentsList(true)
				} else if (that.type == 3) {
					that.getPostList(true)
				} else if (that.type == 4) {
					that.getAppList(true)
				} else {
					that.getSpaceList(true)
				}
			},
			goAppInfo() {
				uni.navigateTo({
					url: '/pages/plugins/sy_appbox/info'
				});
			},
			toJb(title) {
				uni.navigateTo({
					url: '/pages/user/help?type=user&title=' + title
				});
			},
			reload() {
				var that = this;
				if (that.type == 0) {
					that.getContentsList(false);
				} else if (that.type == 1) {
					that.getCommentsList(false)
				} else if (that.type == 3) {
					that.getPostList(false)
				} else if (that.type == 4) {
					that.getAppList(false)
				} else {
					that.getSpaceList(false)
				}
			},
			
			goFanList(uid) {
				uni.navigateTo({
					url: '/pages/user/fanList?uid=' + uid
				});
			},
			getContentsList(isPage) {
				var that = this;
				var token = ""
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				}
				var data = {
					"type": "post",
					"authorId": that.uid,
				}
				var page = that.page;
				if (isPage) {
					page++;
				}
				that.$Net.request({
					url: that.$API.getContentsList(),
					data: {
						"searchParams": JSON.stringify(that.$API.removeObjectEmptyKey(data)),
						"limit": 8,
						"page": page,
						"order": "created",
						"token": token
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						uni.stopPullDownRefresh();
						that.isLoad = 0;
						that.moreText = that.$t('common.loadmoretxt');
						if (res.data.code == 1) {
							var list = res.data.data;
							if (list.length > 0) {
								if (isPage) {
									that.page++;
									that.contentsList = that.contentsList.concat(list);
								} else {
									that.contentsList = list;
								}
							} else {
								that.moreText = that.$t('common.nomoredata');
							}
						}
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					},
					fail: function(res) {
						uni.stopPullDownRefresh();
						that.moreText = that.$t('common.loadmoretxt');
						that.isLoad = 0;
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					}
				})
			},
			// 瀑布流加载完毕事件
			handleWaterFallFinish() {

			},
			getCommentsList(isPage) {
				var that = this;
				var data = {
					"type": "comment",
					"authorId": that.uid,
				}
				var page = that.page;
				if (isPage) {
					page++;
				}
				that.$Net.request({
					url: that.$API.getCommentsList(),
					data: {
						"searchParams": JSON.stringify(that.$API.removeObjectEmptyKey(data)),
						"limit": 5,
						"page": page,
						"order": "created"
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						uni.stopPullDownRefresh();
						that.isLoad = 0;
						if (res.data.code == 1) {
							var list = res.data.data;
							if (list.length > 0) {
								var commentsList = [];
								for (var i in list) {
									var arr = list[i];
									arr.style = "background-image:url(" + list[i].avatar + ");"
									commentsList.push(arr);
								}
								if (isPage) {
									that.page++;
									that.commentsList = that.commentsList.concat(commentsList);
								} else {
									that.commentsList = commentsList;
								}
							} else {
								that.moreText = that.$t('common.nomoredata');
							}
						}
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					},
					fail: function(res) {
						uni.stopPullDownRefresh();
						that.isLoad = 0;
						that.moreText = that.$t('common.loadmoretxt');
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					}
				})
			},
			getIsFollow() {
				var that = this;
				var token = "";
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				}
				var data = {
					token: token,
					touid: that.uid,
				}
				that.$Net.request({

					url: that.$API.isFollow(),
					data: data,
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						that.isFollow = res.data.code;
					},
					fail: function(res) {
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						})
					}
				})
			},
			goLogin() {
				uni.navigateTo({
					url: '/pages/user/login'
				});
			},
			follow(type) {
				var that = this;
				var token = "";
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				} else {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					uni.navigateTo({
						url: '/pages/user/login'
					});
					return false;
				}
				var data = {
					token: token,
					touid: that.uid,
					type: type,
				}
				that.isFollow = type;
				uni.showLoading({
					title: that.$t('common.loadmore')
				});
				that.$Net.request({
					url: that.$API.follow(),
					data: data,
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if (res.data.code == 1) {
							if (type == 1) {
								uni.request({
									url: that.$API.SPguanzhu(),
									method: 'GET',
									data: {
										uid: that.vid,
									},
									dataType: "json",
									success(res) {},
									fail() {
										setTimeout(function() {
											uni.hideLoading();
										}, 1000);
										uni.showToast({
											title: that.$t('common.networkfail'),
											icon: 'none'
										})
									}
								})
							} else {
								uni.request({
									url: that.$API.SPquguan(),
									method: 'GET',
									data: {
										uid: that.vid,
									},
									dataType: "json",
									success(res) {},
									fail() {
										setTimeout(function() {
											uni.hideLoading();
										}, 1000);
										uni.showToast({
											title: that.$t('common.networkfail'),
											icon: 'none'
										})
									}
								})
							}
						}
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
						uni.showToast({
							title: res.data.msg,
							icon: 'none'
						})
						that.getIsFollow();
					},
					fail: function(res) {
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						})
						that.getIsFollow();
					}
				})
			},
			commentsAdd(title, coid, reply) {
				var that = this;
				var cid = that.cid;
				uni.navigateTo({
					url: '/pages/contents/commentsadd?cid=' + cid + "&coid=" + coid + "&title=" + title +
						"&isreply=" + reply
				});
			},
			toPost() {
				uni.navigateTo({
					url: '/pages/edit/articlePost'
				});
			},
			toRz() {
				var that = this;
				if (!localStorage.getItem('token') || localStorage.getItem('token') == "") {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					return false;
				}
				uni.navigateTo({
					url: '/pages/user/identifyblue'
				});
			},
			toUserBg() {
				var that = this;
				if (!localStorage.getItem('token') || localStorage.getItem('token') == "") {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					return false;
				}
				uni.navigateTo({
					url: '/pages/user/userBg'
				});
			},

			toUserEdit() {
				var that = this;
				if (!localStorage.getItem('token') || localStorage.getItem('token') == "") {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					return false;
				}
				uni.navigateTo({
					url: '/pages/user/useredit?backif=1&type=setInfo'
				});
			},
			tosetSafe() {
				var that = this;
				if (!localStorage.getItem('token') || localStorage.getItem('token') == "") {
					uni.showToast({
						title: that.$t('common.plslogin'),
						icon: 'none'
					})
					return false;
				}
				uni.navigateTo({
					url: '/pages/user/useredit?backif=1&type=setSafe'
				});
			},
			toSet() {
				uni.navigateTo({
					url: '/pages/user/setup'
				});
			},
			toEdit(cid) {
				uni.navigateTo({
					url: '/pages/edit/articlePost?type=edit' + '&cid=' + cid
				});
			},
			getUserLv(i) {
				var that = this;
				var rankList = that.$API.GetRankList();
				return rankList[i];
			},
			getUserLvStyle(i) {
				var that = this;
				var rankStyle = that.$API.GetRankStyle();
				var userlvStyle = "color:#fff;background-color: " + rankStyle[i];
				return userlvStyle;
			},
			toInfo(data) {
				uni.navigateTo({
					url: '/pages/contents/info?cid=' + data.cid + "&title=" + data.title
				});
			},
			toInfoComment(cid, title) {
				uni.navigateTo({
					url: '/pages/contents/info?cid=' + cid + "&title=" + title
				});
			},
			toSearch() {
				uni.redirectTo({
					url: '/pages/contents/search'
				});
			},
			toEdit() {
				uni.redirectTo({
					url: '/pages/user/useredit'
				});
			},
			ToCopy(text) {
				var that = this;
				uni.setClipboardData({
					data: text,
					success: () => {
						uni.showToast({
							title: that.$t('common.copysuccess')
						})
					}
				});
				let textarea = document.createElement("textarea");
				textarea.value = text;
				textarea.readOnly = "readOnly";
				document.body.appendChild(textarea);
				textarea.select();
				textarea.setSelectionRange(0, text.length);
				uni.showToast({ //提示
					title: that.$t('common.copysuccess')
				})
				var result = document.execCommand("copy")
				textarea.remove();
			},
			formatNumber(num) {
				return num >= 1e4 ? (num / 1e4).toFixed(1) + '' : num
			},
			replaceSpecialChar(text) {
				if (!text) {
					return false;
				}
				text = text.replace(/&quot;/g, '"');
				text = text.replace(/&amp;/g, '&');
				text = text.replace(/&lt;/g, '<');
				text = text.replace(/&gt;/g, '>');
				text = text.replace(/&nbsp;/g, ' ');
				return text;
			},
			subText(text, num) {
				if (text) {
					if (text.length > num) {
						text = text.substring(0, num);
						return text + "……";
					} else {
						return text;
					}
				} else {
					return this.$t('global.nopersoninfo')
				}
			},
			getSpaceList(isPage) {
				var that = this;
				var token = "";
				if (localStorage.getItem('userinfo')) {
					var userInfo = JSON.parse(localStorage.getItem('userinfo'));
					token = userInfo.token;
				}
				var page = that.page;
				if (isPage) {
					page++;
				}
				var data = {
					"uid": that.uid
				}
				that.$Net.request({
					url: that.$API.spaceList(),
					data: {
						"searchParams": JSON.stringify(that.$API.removeObjectEmptyKey(data)),
						"limit": 10,
						"page": page,
						"order": "created",
						"token": token
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						that.changeLoading = 1;
						that.isLoad = 0;
						that.moreText = that.$t('common.loadmoretxt');
						if (!isPage) {
							that.dataLoad = true;
						}
						if (res.data.code == 1) {
							var list = res.data.data;
							var spaceList = [];
							for (var i in list) {
								if (list[i].type == 0) {
									if (list[i].pic) {
										var pic = list[i].pic;
										list[i].picList = pic.split("||");
									} else {
										list[i].picList = [];
									}
								}
								if (list[i].type == 2) {
									if (list[i].forwardJson.pic) {
										var pic = list[i].forwardJson.pic;
										list[i].forwardJson.picList = pic.split("||");
									} else {
										list[i].forwardJson.picList = [];
									}
								}
							}
							spaceList = list;
							if (list.length > 0) {
								if (isPage) {
									that.page++;
									that.spaceList = that.spaceList.concat(spaceList);
								} else {
									that.spaceList = spaceList;
								}
							} else {
								that.moreText = that.$t('global.nomoredynamic');
							}
						}
					},
					fail: function(res) {
						that.changeLoading = 1;
						that.isLoad = 0;
						that.moreText = that.$t('common.loadmoretxt');
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					}
				})
			},
			getPostList(isPage, isLogin) {
				var that = this;
				if (that.submitStatus1) {
					return false;
				}
				that.submitStatus1 = true;
				var page = that.page;
				var token = "";
				if (!isLogin) {
					localStorage.setItem('isbug', '1');
				}
				if (isPage) {
					page++;
				}
				var data = {
					"status": "1",
					"authorId": that.uid,
				}
				that.$Net.request({
					url: that.$API.postList(),
					data: {
						"searchParams": JSON.stringify(that.$API.removeObjectEmptyKey(data)),
						"limit": 10,
						"page": page,
						"order": 'created',
						"token": token
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "get",
					dataType: 'json',
					success: function(res) {
						if (!isLogin) {
							localStorage.removeItem('isbug');
						}
						that.submitStatus1 = false;
						that.isLoad = 0;
						if (res.data.code == 1) {
							var list = res.data.data;
							if (list.length > 0) {
								var postList = list;
								for (var i in postList) {
									postList[i].isAds = 0;
								}
								if (isPage) {
									that.page++;
									that.postList = that.postList.concat(postList);
								} else {
									that.postList = postList;
								}
							} else {
								if (isPage) {
									that.moreText = that.$t('common.nomoredata');
								} else {
									that.postList = [];
								}
							}
						} else {
							if (res.data.msg == "用户未登录或Token验证失败") {
								if (isLogin) {
									that.isuserlogin = true
								} else {
									that.getPostList(isPage, true);
								}
							}
						}
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					},
					fail: function(res) {
						if (!isLogin) {
							localStorage.removeItem('isbug');
						}
						that.submitStatus1 = false;
						that.changeLoading = 1;
						that.isLoad = 0;
						that.moreText = that.$t('common.loadmoretxt');
						var timer = setTimeout(function() {
							that.isLoading = 1;
							clearTimeout('timer')
						}, 300)
					}
				})
			},
			getLocal(local) {
				var that = this;
				if (local && local != '') {
					var local_arr = local.split("|");
					if (!local_arr[3] || local_arr[3] == 0) {
						return local_arr[2];
					} else {
						return local_arr[3];
					}
				} else {
					return that.$t('global.unknown')
				}

			},
			getAppBoxInfo(){
				var that = this;
				uni.request({
					url: that.$API.PluginLoad('sy_appbox'),
					data: {
						"action": "getConfig"
					},
					method: 'GET',
					dataType: "json",
					success(res) {
						if(res.data.code == 200) {
							that.appModOrder = res.data.data.appModOrder;
						} else {
							console.log(res.data.msg)
						}
						that.getSetCC();
					},
					fail(error) {
						that.apploading = false;
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						});
					}
				});
			},
			// 获取用户应用列表
			getAppList(isPage) {
				const that = this;
				if(that.apploading) return;
				if(!isPage) {
					that.apppage = 1;
					that.dataLoad = true;
					that.apploading = true;
				}
				let page = that.apppage;
				if(isPage) {
					page++;
				}
				const data = {
					authorId: that.uid
				};
				uni.request({
					url: that.$API.PluginLoad('sy_appbox'),
					data: {
						"action": "getAppList",
						"getapp_page": page,
						"getapp_limit": 10,
						"getapp_order": "created",
						"getapp_if": JSON.stringify(that.$API.removeObjectEmptyKey(data))
					},
					method: 'GET',
					dataType: "json",
					success(res) {
						if(res.data.code == 200) {
							const list = res.data.data || []; // 添加空数组作为默认值
							if(list.length > 0) {
								const mappedList = list.map(item => {
									return {
										...item,
										tagInfo: {
											text: item.type == 1 ? that.$t('global.transport') : 
												item.type == 2 ? that.$t('global.original') : 
												item.type == 3 ? that.$t('global.goldlabel') : 
												item.type == 4 ? that.$t('global.official') : that.$t('global.unknown'),
											color: item.type == 1 ? '#7c72ff' : 
												item.type == 2 ? '#19be6b' : 
												item.type == 3 ? '#ff6600' : 
												item.type == 4 ? '#2979ff' : '#999'
										},
										size: that.formatSize(item.size)
									};
								});
								that.isLoad = 0;
								if(isPage) {
									if(list.length < 1) {
										that.moreText = that.$t('common.nomoredata');
									}
									that.applist = [...that.applist, ...mappedList];
									that.apppage = page;
								} else {
									that.applist = mappedList;
									that.apppage = 1;
								}
							} else {
								if(!isPage) {
									that.applist = [];
								}
								that.moreText = that.$t('common.nomoredata');
							}
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none'
							});
						}
						that.apploading = false;
					},
					fail(error) {
						that.apploading = false;
						uni.showToast({
							title: that.$t('common.networkfail'),
							icon: 'none'
						});
					}
				});
			},
			// 格式化文件大小
			formatSize(size) {
				if(!size) return this.$t('global.unknownsize');
				if(size >= 1024 * 1024) {
					return (size / (1024 * 1024)).toFixed(1) + 'Gb';
				} else if(size >= 1024) {
					return (size / 1024).toFixed(1) + 'Mb';  
				} else {
					return size + 'Kb';
				}
			},
			toAppInfo(id) {
				uni.navigateTo({
					url: '/pages/plugins/sy_appbox/info?id=' + id
				});
			},
		}
	}
</script>

<style>
	.text-content {
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 10;
		-webkit-box-orient: vertical;
	}

	.text-shojo2 {
		color: #ff6c3e;
	}

	.user-info-data {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.xyy {
		margin-left: 0px;
	}

	.search-type {
		display: flex;
		position: relative;
		align-items: center;
		justify-content: space-around;
		border-bottom: solid 4upx #f3f3f3;
	}

	.search-type-box.active {
		border-bottom: solid 4upx #000000;
		color: #000000;
	}

	.user-info-data-box {
		flex-grow: 1;
		text-align: center;
	}

	.user-data-num {
		margin-right: 0px;
		font-size: 36upx;
	}

	.user-data-label {
		font-size: 28upx;
	}

	.sup-script {
		font-size: 28upx;
		font-weight: 400;
	}

	.cu-bar .action2 {
		background: #00000057;
		width: 80upx;
		height: 80upx;
		border-radius: 50%;
		/* text-align: center; */
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.grid2 {
		display: flex;
		flex-direction: row;
		justify-content: normal;
	}

	.cu-bar2 {
		margin-top: 10upx;
	}

	.userIndex .header .action {
		font-size: 36upx;
	}

	.user-rz {
		position: relative;
		display: inline-block;
	}

	.user-rz-icon {
		position: absolute;
		right: 0upx;
		bottom: 0upx;
		width: 60upx;
		height: 60upx;
	}

	/*  #ifdef MP || APP-PLUS */
	.user-header image {
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
	}

	/*  #endif */
	.user-info-main {
		/*  #ifdef H5 || APP-PLUS */
		height: 480rpx;
		/*  #endif */
		/*  #ifdef MP */
		height: 450rpx;
		/*  #endif */
	}

	.tn-margin-top-xxl {
		margin-top: 60upx;
	}

	.center-container {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.userlv {
		margin-top: 0px;
	}

	.app-box {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx;
		border-bottom: 1px solid #f5f5f5;
	}

	.app-box-body {
		flex: 1;
		display: flex;
		margin-right: 20rpx;
		min-width: 0;
	}

	.app-box-logo {
		width: 110rpx;
		height: 110rpx;
		flex-shrink: 0;
	}

	.app-box-content {
		flex: 1;
		margin-left: 20rpx;
		min-width: 0;
	}

	.app-box-title {
		font-size: 30rpx;
		font-weight: bold;
		margin-bottom: 8rpx;
		width: 400rpx;
	}

	.app-box-info {
		font-size: 26rpx;
		color: #666;
		margin-bottom: 8rpx;
	}

	.app-box-info text {
		margin-right: 10rpx;
	}

	.app-box-tags {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	}

	.app-tag {
		padding: 4rpx 12rpx;
		border-radius: 8rpx;
		color: #ffffff;
		margin-right: 12rpx;
		font-size: 24rpx;
	}
	.app-category-tag {
			padding: 4rpx 12rpx;
			border-radius: 8rpx;
			background-color: #f5f5f5;
			color: #666666;
			margin-right: 12rpx;
			font-size: 24rpx;
		}

	.app-box-down {
		background-color: #3cc9a4;
		color: #fff;
		padding: 10rpx 30rpx;
		border-radius: 100rpx;
		white-space: nowrap;
	}

	.text-cut {
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
	}
</style>